package edu.mercer.medapps.documentbldr;

import com.google.common.collect.ImmutableSet;

/**
 * Minimum of common values, methods for Documents.<p>
 * 
 * <ul>
 * <li>enumerations: individual property names and other constants
 * <li>Z properties() requirement for Documents, example: DocumentProperties
 * </ul>
 * 
 * Generic usage allows for variety of collections or other objects usage to
 * provide container, access to the properties.<p>
 */

interface Document<Z>
{
	/** Document constants.<p> */
	
	enum QUALITIES
	{
		/** String literal representing an unset value; i.e., "empty" */
		
		EMPTY ("empty");

		private String _value = "";

		QUALITIES(final String valIn)
		{
			_value = valIn;
			
		} //constructor

		
		/** @return String - enumeration constant String value */

		public String text(){ return _value; }

		@Override
		public String toString(){ return text(); }

		
	}//enum

	/** 
	 * Document attributes.<p> 
	 * 
	 * Literals for properties. Standard for property names across Document and
	 * related interfaces and implementing classes.
	 * 
	 * <ul> 
	 * <li> name - String document title
	 * <li> filename - String document filename 
	 * <li> set - Collection of type set suitable for iteration as properties' 
	 * 		keyset
	 * 
	 * </ul>
	 */
	
	enum FEATURES
	{
		/** String - document title */
		
		NAME ("name"),
		
		/** String - document file name */
		
		FILENAME ("filename"),
		
		/** @see EXPOSED */
		
		SET;
				
		/** 
		 * ImmutableSet - Collection, read-only, contains enumeration values<p> 
		 * 
		 * As defined in FEATURES; i.e., "name", "filename"<p>
		 */
		
		final ImmutableSet<String> EXPOSED = ImmutableSet.of(
				"name", 
				"filename");
		
		private String _value = "";
		
		private FEATURES(){} //constructor
				
		private FEATURES(final String valueIn)
		{ 
			_value = valueIn; 
			
		} //constructor

		
		/** @return String - enumeration constant String value */
		
		public String text(){ return _value; }

		@Override
		public String toString(){ return text(); }

		
	}//enum


	/** 
	 * Document properties method.<p>
	 * 
	 * Provides container for and access to document properties.<p>
	 * 
	 * @return Generic.<p>
	 */
	
	Z properties();

	
}//interface
